<?php
	session_start();
	mysql_connect("localhost", "sapmenet_admin", "a1s2d3f4g5h6j7") or die ("Problem with datebase");
	mysql_select_db("sapmenet_users");
	$id=mysql_query("SELECT userId FROM publications WHERE ID={$_POST['pubID']}");
	if (mysql_num_rows($id)>0)
	{
	$id=mysql_result($id, 0);
	if ($id==$_SESSION['JID'])
	{
		mysql_query("DELETE FROM PubComments WHERE pubID={$_POST['pubID']}");
		mysql_query("DELETE FROM publications WHERE ID={$_POST['pubID']}");
	}
	else echo "napsuvai";
	}
	else echo "napsuvai";
?>